﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="_Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>爱尚洗车-管理平台</title>
    <link href="Styles/style.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(function () {
            //检测IE
            var browser = navigator.appName
            var b_version = navigator.appVersion
            var version = b_version.split(";");
            var trim_Version = version[1].replace(/[ ]/g, "");
            if (browser == "Microsoft Internet Explorer" && (trim_Version == "MSIE6.0" || trim_Version == "MSIE7.0")) {
                window.location.href = 'ieupdate.html';
            }
            $(":input[id$='btnLogin']").click(function () {
                //数据验证
                if ($(":input[id$='UserName']").val() != undefined && $(":input[id$='UserName']").val().replace(/\ +/g, "").length == 0) {
                    $("#FailureText").html("请输入用户名");
                    $(":input[id$='UserName']").focus();
                    return false;
                } else if ($(":input[id$='PassWord']").val().replace(/\ +/g, "").length == 0) {
                    $("#FailureText").html("请输入密码");
                    $(":input[id$='PassWord']").focus();
                    return false;
                }
                else if ($(":input[id$='txtYZM']").val().replace(/\ +/g, "").length == 0) {
                    $("#FailureText").html("请输入验证码");
                    $(":input[id$='txtYZM']").focus();
                    return false;
                }
                return true;
            });

            $(":input[id$='txtYZM']").val('');
        });
        function ShowImg() {
            $("#YZM").attr('src', "getRand.aspx?_" + Math.random());
        }
    </script>
</head>
<body class="loginbody">
    <form id="form1" runat="server">
    <div class="login-screen">
        <div class="login-form">
            <h1>
                用户登录</h1>
            <div class="control-group">
                <asp:TextBox ID="UserName" runat="server" CssClass="login-field" placeholder="用户名"
                    title="用户名"></asp:TextBox>
                <label class="login-field-icon user" for="UserName">
                </label>
                <asp:Label ID="LabTtitle" runat="server" Visible="false">您目前已登录账户: </asp:Label>
                <asp:Label ID="LabUserName" runat="server" Visible="false"></asp:Label>
            </div>
            <div class="control-group">
                <asp:TextBox ID="PassWord" runat="server" CssClass="login-field" TextMode="Password"
                    placeholder="密码" title="密码">
                </asp:TextBox>
                <label class="login-field-icon pwd" for="PassWord">
                </label>
            </div>
            <div class="control-group" style="text-align: left;">
                <asp:TextBox ID="txtYZM" runat="server" CssClass="login-field" Style="width: 150px;
                    vertical-align: middle;" title="验证码" placeholder="验证码"></asp:TextBox>
                <img id="YZM" alt="点击更换" onclick="ShowImg();" src="getRand.aspx" style="width: 100px;
                    height: 40px; vertical-align: middle; margin-bottom: 10px; cursor: pointer;" />
            </div>
            <div>
                <asp:Button ID="btnLogin" runat="server" Text="登 录" CssClass="btn-login" OnClick="btnLogin_Click" />
            </div>
            <span class="login-tips"><i></i><b>
                <asp:Label ID="FailureText" runat="server">请输入用户名和密码</asp:Label></b></span>
        </div>
    </div>
    </form>
</body>
</html>
